using System;
using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class BodyType
    {

        private Nullable<uint> _Columns;
        private string _ColumnSpacing;
        private string _Height;
        private ReportItemsTypeComposite _ReportItems;
        private StyleType _Style;

        public Nullable<uint> Columns
        {
            get
            {
                return _Columns;
            }
            set
            {
                _Columns = value;
            }
        }

        public string ColumnSpacing
        {
            get
            {
                return _ColumnSpacing;
            }
            set
            {
                _ColumnSpacing = value;
            }
        }

        public string Height
        {
            get
            {
                return _Height;
            }
            set
            {
                _Height = value;
            }
        }

        public ReportItemsTypeComposite ReportItems
        {
            get
            {
                if (_ReportItems == null)
                    _ReportItems = new ReportItemsTypeComposite();
                return _ReportItems;
            }
            set
            {
                _ReportItems = value;
            }
        }

        public StyleType Style
        {
            get
            {
                if (_Style == null)
                    _Style = new StyleType();
                return _Style;
            }
            set
            {
                _Style = value;
            }
        }

        public BodyType()
        {
            _Columns = new Nullable<uint>[]();
        }

        public BodyType Write()
        {
            BodyType bodyType = new BodyType();
            ArrayList arrayList1 = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            if (_ColumnSpacing != null)
            {
                arrayList1.Add(_ColumnSpacing);
                arrayList2.Add(1);
            }
            if (_Columns.get_HasValue())
            {
                arrayList1.Add(_Columns);
                arrayList2.Add(2);
            }
            if (_Height != null)
            {
                arrayList1.Add(_Height);
                arrayList2.Add(3);
            }
            if (_ReportItems != null)
            {
                arrayList1.Add(_ReportItems.Write());
                arrayList2.Add(4);
            }
            if (_Style != null)
            {
                arrayList1.Add(_Style.Write());
                arrayList2.Add(5);
            }
            bodyType.Items = arrayList1.ToArray();
            bodyType.ItemsElementName = (ItemsChoiceType30[])arrayList2.ToArray(typeof(ItemsChoiceType30));
            arrayList2 = arrayList1 = null;
            return bodyType;
        }

    } // class BodyType

}

